home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Archives
/
ForCLI
/
HexD2.lha
/
HexD.Man
< prev
Wrap
Text File
|
1993-02-21
|
6KB
|
171 lines
HexD V2.0 USER COMMANDS HexD V2.0
NAME
HexD - Print a file, using "hex" format.
SYNOPSIS
HexD FILES/M,TO/K,WIDTH/K/N,ALL/S,APPEND/S,HEX/S,ASCII/S,
NOOFFSET/S,HEADER/S,CURSOR/S,PAGE/S
DESCRIPTION
HexD takes each filename, and tries to write the file in hex
format on standard output (or a file). If no filename was given,
HexD will read from standard input. By default, this means that
each line looks like this:
<offset:> <hex representation> <ascii representation>
Offset is simply the offset of the first byte on each line.
Hex representation is the value of the bytes (in hexadecimal
format), ordered in groups of four bytes (one longword), with
each group separated by a space.
Ascii representation is the ascii (character) form of the byte,
or "·" if no valid char exists.
An example: The first three lines of this file looks like this
(using default settings, except for width, which is 60):
000000: 0a202020 20486578 44202020 202020 '· HexD '
00000f: 20202020 20202020 20202020 202020 ' '
00001e: 20202055 53455220 434f4d4d 414e44 ' USER COMMAND'
Pressing ctrl-c will break the program, and pressing ctrl-d will
cause a "file break", i.e. HexD will stop processing the current
file, and will move to the next one (if any).
HexD is pure, and may be made resident.
Thanks to Justin V. McCormick for his GetWinBounds() routine,
found in LS v3.1. A slightly adopted version is used in HexD.
INPUTS
FILES/M
The files to print. Any number of files may be specified
(the shell, or the amount of free memory may limit this),
including zero, in which case standard input will be read
(very useful for pipes etc). These filenames may contain
standard AmigaDOS patterns.
TO/K
Specifies a file to which the output will be printed. If not
specified, print everything to standard output. You should
use this option rather than using the ">" shell construct,
since by using this parameter, any errors and breaks will be
printed in the shell window rather than in the output file.
WIDTH/K/N
The number of chars the display should use as a max (the
acutal amount used may be somewhat smaller than this). This
number should be less than 512. The minimal width depends on
the display format currently in use, and it will ensure that
at least one byte will fit within the width limit. If not
specified, and the output is in a "CON: window", the width
of the window and font will set the width. The size of the
window will be re-checked after each file, and after each
page prompt (if paging was enabled). If the window gets too
narrow, HexD will exit with a suitable message. If output
isn't a CON: window (and this parameter wasn't specified),
75 chars will be used.
ALL/S
Makes HexD enter all direcotries it finds during the search
for matching files. If not specified, directories are
ignored.
APPEND/S
Normally, HexD will overwrite any TO file if it should exist.
By specifying this option, HexD will instead append to the
file if it should exist. If no TO file was specified, this
option have no effect.
HEX/S
Make the output only contain the hex representation. If ASCII
is used at the same time, the normal output format will be
used.
ASCII/S
Make the output only contain the ascii representation. If HEX
is used at the same time, the normal output format will be
used.
NOOFFSET/S
Do not print the offset at the start of each line.
HEADER/S
Print the name of each file before it is processed. If no
filename was given (i.e. standard input is read) this switch
will have no effect.
CURSOR/S
Normally, HexD will "hide" the cursor during printing, in
order to increase the output speed (this will only be done if
the output is in a "CON: window"). This switch will disable
that (i.e. cursor is not "hidden").
PAGE/S
Make HexD "page" the output, i.e. show a prompt and wait for
a key-press after each screenful of output. This will only
happen if the output is in a CON: window. There are a few
keys which will do something special:
Return : Display next line.
S : No more page prompts for this file.
= : No more page prompts for this run of HexD.
Backspace : Show previous page of this file.
All other keys will show the next page.
RESULTS
The file(s) printed in hex format.
NOTES
All error messages will be printed to standard output.
An interesting thing about this program is that it is noticably
faster than most other similar programs, such as C='s "Type"
(V37.2), Xd (unknown version, part of the SKSh package version
1.4 or something like that) etc. As a matter of fact, it is the
fastest (CLI-based) hexdumper I have. It is also the most
flexible. :)
I made a test, by dumping an executable to a file in RAM:, and
HexD was ~2.5 times faster than Type. The file was almost 70 Kb
large, and it took Hexd ~35 secs on my unaccelerated Amiga 500
(both times the program in question was cached, so it was
basically ram to ram "conversion").
The source is really a bit messy. I ought to clean it up some
day.. :)
COPYRIGHT
This program is purely public domain. But leave my name in it,
will you? I would appriciate it.. :)
AUTHOR
Magnus Holmgren. (V1.0-2.0)
AUTHOR CONTACT
Magnus Holmgren:
You can reach me via internet, on these addresses:
cmh@augs.se or
cmh@lysator.liu.se or
magnus_holmgren@augs.liu.se or
d91magho@und.ida.liu.se
Echo-mail (fidonet) should work too. Send it to 2:204/404.6
Otherwise snailmail is recommended to this address:
Magnus Holmgren
Rydsvägen 254 A:14
S-582 51 Linköping
SWEDEN